import request from '@/utils/request'

/**
 *
 * @param {data} 入参
 * @abstract 管理员增删改查接口
 */
export function addAdsAjax(data) {
  return request({
    url: '/admin/rddAds',
    method: 'post',
    headers: { "Content-Type": "multipart/form-data" },
    data: data
  })
}

export function updateAdsAjax(data) {
  return request({
    url: '/admin/rddAds/' + data.id,
    method: 'put',
    data: { ...data }
  })
}

export function getAdsAjax(data) {
    return request({
      url: '/admin/rddAds/' + data.id,
      method: 'get',
      params: { ...data }
    })
  }

export function fetchAdsAjax(data) {
  return request({
    url: '/admin/rddAds',
    method: 'get',
    params: { ...data }
  })
}

export function delAdsAjax(data) {
  return request({
    url: '/admin/rddAds/' + data.id,
    method: 'delete'
  })
}

export function uploadImg(data) {
  return request({
    url: '/admin/img/' + data.id,
    method: 'delete'
  })
}
